package com.own.component.log.login.entity;

import com.own.component.common.login.user.BaseLoginUser;
import com.own.component.log.login.em.LogLoginStatusEnum;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Map;

/**
 * LogLoginEntity
 *
 * @author chenxueli
 * @date 2023-08-08 15:36:00
 */
@Getter
@Setter
@Accessors(chain = true)
public class LogLoginEntity implements Serializable {

    public static final LogLoginEntity NONE = new LogLoginEntity().setStatus(LogLoginStatusEnum.FAIL);

    /**
     * 登录状态
     */
    public LogLoginStatusEnum status;

    /**
     * 登录失败时候的信息
     */
    private String message = "登录成功";

    /**
     * 登录的用户信息
     */
    private BaseLoginUser loginUser;

    /**
     * ip信息
     */
    private String ip;

    /**
     * 客户端信息
     */
    private String client;

    /**
     * 登录账号
     */
    private String loginAccount;

    /**
     * 登录方式
     */
    private String loginType;

    /**
     * 登录密码或者验证码
     */
    private String loginCode;

    /**
     * 额外的信息
     */
    private Map<String, Object> extra;

    /**
     * 请求header信息
     */
    private Map<String, String> headers;

    /**
     * 登录时间
     */
    private LocalDateTime loginTime;

    /**
     * 链路id
     */
    private String traceId;

}
